<!DOCTYPE html>

<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Bullish vs Bearish - Remember Which is Which!</title>
  <style>
    * {
      box-sizing: border-box;
    }
body {
  font-family: Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  overflow: hidden;
}

.header {
  background: linear-gradient(45deg, #2c3e50, #34495e);
  color: white;
  text-align: center;
  padding: 30px;
}

.header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 300;
}

.subtitle {
  margin: 10px 0 0 0;
  opacity: 0.8;
  font-size: 1.1rem;
}

.comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.side {
  padding: 40px 30px;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease;
}

.side:hover {
  transform: translateY(-5px);
}

.bullish {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
}

.bearish {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
}

.animal-container {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.animal-svg {
  width: 150px;
  height: 150px;
  transition: transform 0.5s ease;
  cursor: pointer;
}

.animal-svg:hover {
  transform: scale(1.1) rotate(5deg);
}

.term {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.meaning {
  font-size: 1.3rem;
  margin-bottom: 20px;
  font-weight: 300;
}

.direction {
  font-size: 3rem;
  margin-bottom: 15px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.memory-tip {
  background: rgba(255,255,255,0.1);
  padding: 15px;
  border-radius: 10px;
  margin-top: 20px;
  font-style: italic;
}

.quiz-section {
  background: #f8f9fa;
  padding: 40px;
  text-align: center;
}

.quiz-title {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #2c3e50;
}

.quiz-button {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 18px;
  border-radius: 25px;
  cursor: pointer;
  transition: transform 0.3s ease;
  font-family: Helvetica, Arial, sans-serif;
}

.quiz-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.quiz-result {
  margin-top: 20px;
  font-size: 1.2rem;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .comparison {
    grid-template-columns: 1fr;
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .side {
    padding: 30px 20px;
  }
}

  </style>
</head>
<body>
  <div class="container">
    <div class="header">
      <h1>Bullish vs Bearish</h1>
      <p class="subtitle">Remember which is which with these friendly animals!</p>
    </div>
<div class="comparison">
  <div class="side bullish">
    <div class="animal-container">
      <svg class="animal-svg" viewBox="0 0 200 200" id="bull-svg">
        <!-- Bull SVG -->
        <defs>
          <radialGradient id="bullGradient" cx="50%" cy="30%" r="70%">
            <stop offset="0%" stop-color="#8B4513"/>
            <stop offset="100%" stop-color="#654321"/>
          </radialGradient>
        </defs>
        <!-- Bull body -->
        <ellipse cx="100" cy="120" rx="60" ry="40" fill="url(#bullGradient)"/>
        <!-- Bull head -->
        <circle cx="100" cy="80" r="35" fill="url(#bullGradient)"/>
        <!-- Bull horns -->
        <path d="M 75 60 Q 70 45 65 50" stroke="#FFE4B5" stroke-width="4" fill="none" stroke-linecap="round"/>
        <path d="M 125 60 Q 130 45 135 50" stroke="#FFE4B5" stroke-width="4" fill="none" stroke-linecap="round"/>
        <!-- Bull eyes -->
        <circle cx="90" cy="75" r="4" fill="white"/>
        <circle cx="110" cy="75" r="4" fill="white"/>
        <circle cx="90" cy="75" r="2" fill="black"/>
        <circle cx="110" cy="75" r="2" fill="black"/>
        <!-- Bull nose -->
        <ellipse cx="100" cy="90" rx="8" ry="6" fill="#F4A460"/>
        <circle cx="97" cy="88" r="1" fill="black"/>
        <circle cx="103" cy="88" r="1" fill="black"/>
        <!-- Bull legs -->
        <rect x="75" y="150" width="8" height="25" fill="#654321"/>
        <rect x="90" y="150" width="8" height="25" fill="#654321"/>
        <rect x="110" y="150" width="8" height="25" fill="#654321"/>
        <rect x="125" y="150" width="8" height="25" fill="#654321"/>
      </svg>
    </div>
    
    <div class="direction">📈 ↗️</div>
    <div class="term">BULLISH</div>
    <div class="meaning">Optimistic • Positive • Going UP!</div>
    
    <div class="memory-tip">
      🐂 Bulls attack by thrusting their horns <strong>UPWARD</strong>
    </div>
  </div>

  <div class="side bearish">
    <div class="animal-container">
      <svg class="animal-svg" viewBox="0 0 200 200" id="bear-svg">
        <!-- Bear SVG -->
        <defs>
          <radialGradient id="bearGradient" cx="50%" cy="30%" r="70%">
            <stop offset="0%" stop-color="#8B4513"/>
            <stop offset="100%" stop-color="#5D4037"/>
          </radialGradient>
        </defs>
        <!-- Bear body -->
        <ellipse cx="100" cy="130" rx="55" ry="45" fill="url(#bearGradient)"/>
        <!-- Bear head -->
        <circle cx="100" cy="75" r="40" fill="url(#bearGradient)"/>
        <!-- Bear ears -->
        <circle cx="80" cy="50" r="15" fill="url(#bearGradient)"/>
        <circle cx="120" cy="50" r="15" fill="url(#bearGradient)"/>
        <circle cx="80" cy="50" r="8" fill="#D2691E"/>
        <circle cx="120" cy="50" r="8" fill="#D2691E"/>
        <!-- Bear eyes -->
        <circle cx="88" cy="70" r="4" fill="white"/>
        <circle cx="112" cy="70" r="4" fill="white"/>
        <circle cx="88" cy="70" r="2" fill="black"/>
        <circle cx="112" cy="70" r="2" fill="black"/>
        <!-- Bear snout -->
        <ellipse cx="100" cy="85" rx="12" ry="8" fill="#D2691E"/>
        <!-- Bear nose -->
        <ellipse cx="100" cy="82" rx="4" ry="3" fill="black"/>
        <!-- Bear mouth -->
        <path d="M 95 90 Q 100 95 105 90" stroke="black" stroke-width="2" fill="none"/>
        <!-- Bear arms/claws -->
        <ellipse cx="60" cy="120" rx="12" ry="8" fill="url(#bearGradient)" transform="rotate(-20 60 120)"/>
        <ellipse cx="140" cy="120" rx="12" ry="8" fill="url(#bearGradient)" transform="rotate(20 140 120)"/>
        <!-- Bear legs -->
        <rect x="80" y="165" width="12" height="20" fill="#5D4037"/>
        <rect x="108" y="165" width="12" height="20" fill="#5D4037"/>
      </svg>
    </div>
    
    <div class="direction">📉 ↘️</div>
    <div class="term">BEARISH</div>
    <div class="meaning">Pessimistic • Negative • Going DOWN!</div>
    
    <div class="memory-tip">
      🐻 Bears attack by swiping their claws <strong>DOWNWARD</strong>
    </div>
  </div>
</div>

<div class="quiz-section">
  <h2 class="quiz-title">Test your memory!</h2>
  <button class="quiz-button" id="quiz-btn">Random Quiz Question</button>
  <div class="quiz-result" id="quiz-result"></div>
</div>

  </div>

  <script type="module">
const quizBtn = document.getElementById('quiz-btn');
const quizResult = document.getElementById('quiz-result');
const bullSvg = document.getElementById('bull-svg');
const bearSvg = document.getElementById('bear-svg');

const questions = [
  {
    question: "If the market is going UP and investors are optimistic, that's called...",
    answer: "BULLISH 🐂📈",
    explanation: "Correct! Bulls thrust upward, just like a rising market!"
  },
  {
    question: "If the market is going DOWN and investors are pessimistic, that's called...",
    answer: "BEARISH 🐻📉",
    explanation: "Right! Bears swipe downward, just like a falling market!"
  },
  {
    question: "Which animal attacks by thrusting UPWARD?",
    answer: "BULL 🐂",
    explanation: "Yes! Bulls use their horns to thrust upward!"
  },
  {
    question: "Which animal attacks by swiping DOWNWARD?",
    answer: "BEAR 🐻",
    explanation: "Exactly! Bears use their claws to swipe downward!"
  },
  {
    question: "If someone says 'I'm bullish on this stock', they mean...",
    answer: "They think it will go UP! 📈",
    explanation: "Perfect! Bullish = optimistic = expecting prices to rise!"
  },
  {
    question: "If someone says 'I'm bearish on this market', they mean...",
    answer: "They think it will go DOWN! 📉",
    explanation: "Correct! Bearish = pessimistic = expecting prices to fall!"
  }
];

let currentQuestion = null;
let showingAnswer = false;
let recentQuestions = []; // Keep track of recent questions

function getRandomQuestion() {
  // Get available questions (exclude the last 2 shown)
  const availableQuestions = questions.filter((question, index) => 
    !recentQuestions.includes(index)
  );
  
  // If we've exhausted most questions, reset and just avoid the last one
  if (availableQuestions.length === 0) {
    recentQuestions = recentQuestions.slice(-1); // Keep only the most recent
    return getRandomQuestion(); // Try again
  }
  
  // Select random question from available ones
  const randomIndex = Math.floor(Math.random() * availableQuestions.length);
  const selectedQuestion = availableQuestions[randomIndex];
  
  // Find the original index of the selected question
  const originalIndex = questions.indexOf(selectedQuestion);
  
  // Add to recent questions and maintain only last 2
  recentQuestions.push(originalIndex);
  if (recentQuestions.length > 2) {
    recentQuestions.shift(); // Remove oldest
  }
  
  return selectedQuestion;
}

function displayQuestion() {
  currentQuestion = getRandomQuestion();
  quizResult.innerHTML = `
    <div style="font-weight: bold; color: #2c3e50; margin-bottom: 10px;">
      ${currentQuestion.question}
    </div>
    <div style="font-size: 0.9rem; color: #7f8c8d;">
      Click again to see the answer!
    </div>
  `;
  showingAnswer = false;
}

function displayAnswer() {
  quizResult.innerHTML = `
    <div style="font-weight: bold; color: #27ae60; margin-bottom: 8px; font-size: 1.3rem;">
      ${currentQuestion.answer}
    </div>
    <div style="color: #2c3e50;">
      ${currentQuestion.explanation}
    </div>
  `;
  showingAnswer = true;
}

quizBtn.addEventListener('click', () => {
  if (!currentQuestion || showingAnswer) {
    displayQuestion();
    quizBtn.textContent = 'Show Answer';
  } else {
    displayAnswer();
    quizBtn.textContent = 'New Question';
  }
});

// Add click animations to the animals
bullSvg.addEventListener('click', () => {
  bullSvg.style.animation = 'none';
  setTimeout(() => {
    bullSvg.style.animation = 'bounce 0.6s ease-in-out';
  }, 10);
});

bearSvg.addEventListener('click', () => {
  bearSvg.style.animation = 'none';
  setTimeout(() => {
    bearSvg.style.animation = 'bounce 0.6s ease-in-out';
  }, 10);
});

// Initialize with a welcome message
quizResult.innerHTML = `
  <div style="color: #7f8c8d;">
    Ready to test your knowledge? Click the button above!
  </div>
`;
  </script>

</body>
</html>
